/*
 *  Created at 2011-01-19 23:31 GMT-03:00
 *  Author: Victor Williams Stafusa da Silva
 *  JSmartUnit
 */
package org.jsmartunit.statement;

import org.jsmartunit.model.TestRunner;
import org.junit.runner.Description;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.model.Statement;

/**
 * @author Victor Williams Stafusa da Silva
 */
public final class NotifyIgnoreRunner {

    private NotifyIgnoreRunner() {}

    public static Statement ignorerFor(final Description description, final RunNotifier notifier) {
        return new Statement() {
            @Override
            public void evaluate() {
                notifier.fireTestIgnored(description);
            }
        };
    }

    public static Statement ignorerFor(final TestRunner runner, final RunNotifier notifier) {
        return new Statement() {
            @Override
            public void evaluate() throws Throwable {
                ignorerFor(runner.getDescription(), notifier).evaluate();
            }
        };
    }
}
